package com.weixing.mall.pay;

import com.weixing.mall.pay.channel.ali.AliPayFactory;
import com.weixing.mall.pay.channel.wx.WxPayFactory;
import com.weixing.mall.pay.enums.PayChannelEnum;

/**
 * @ClassName PayFactoryBuilder
 * @Description
 * @Author Small
 * @Date 2019/12/4 19:26
 * @Version 1.0
 **/
public class PayFactoryBuilder {

    public static IPayFactory buildPayFactory(PayChannelEnum payChannel) {
        IPayFactory payFactory = null;
        switch (payChannel) {
            case WX_PAY:
                payFactory = new WxPayFactory();
                break;
            case ALI_PAY:
                payFactory = new AliPayFactory();
                break;
        }
        return payFactory;
    }
}
